import request from "@/utils/request";

// 查询用户信息
export function getUserInfo() {
  return request({
    url: "/user/info",
    method: "get",
  });
}

// 用户查询
export function getUser(data) {
  return request({
    url: "/user/" + data,
    method: "get",
  });
}

// 分页用户查询
export function listPageUsers(data) {
  return request({
    url: "/user/pages",
    method: "get",
    params: data,
  });
}

// 新增用户
export function insertUser(data) {
  return request({
    url: "/user",
    method: "post",
    data,
  });
}

// 编辑用户
export function updateUser(data) {
  return request({
    url: "/user",
    method: "put",
    data,
  });
}

// 批量删除用户
export function deleteUsers(data) {
  return request({
    url: "/user",
    method: "delete",
    params: data,
  });
}

// 删除用户
export function deleteUser(data) {
  return request({
    url: "/user/" + data,
    method: "delete",
  });
}

// 重置用户密码
export function resetPassword(data) {
  return request({
    url: "/user/password/" + data,
    method: "put",
  });
}
